public class Main {
    public static void main(String[] args) {
        // 创建旧的打印机对象
        OldPrinter oldPrinter = new OldPrinter();

        // 使用适配器将其转化为新的 Printer 接口
        Printer printer = new PrinterAdapter(oldPrinter);
        printer.print("Adapter Design Pattern in Action!");

        // 使用适配器将其转化为新的 Scanner 接口
        Scanner scanner = new ScannerAdapter(oldPrinter);
        scanner.scan("Scanning with Adapter Pattern!");
    }
}
